<?php 
class Patient extends ci_controller {




function display($sort_by = 'title', $sort_order = 'asc', $offset = 0) {
		
		$limit = 10;
		$table='PATIENT';
		$data['fields'] = array(
			'title' => 'Title',
			'firstName' => 'First Name',
			'lastName' => 'Last Name',
			
			
		);
		 
		$this->load->model('employee_model');
		$results = $this->employee_model->list_employees($limit, $offset, $sort_by, $sort_order, $table);
		$data['employees'] = $results['rows'];
		$data['num_results'] = $results['num_rows'];
		
		// pagination
		$this->load->library('pagination');
		$config = array();
		$config['base_url'] = site_url("patient/display_employees/$sort_by/$sort_order");
		$config['total_rows'] = $data['num_results'];
		$config['per_page'] = $limit;
		$config['uri_segment'] = 5;
		$this->pagination->initialize($config);
		$data['pagination'] = $this->pagination->create_links();
		
		$data['sort_by'] = $sort_by;
		$data['sort_order'] = $sort_order;

		 $data['main_content']='view_staff';
		  $data['entity']='patient';
		 $this->load->view('includes/template',$data);
		
	}






















function add_employee()
{
	$data=array();
				$this->load->model('employee_model');
				if ($q=$this->employee_model->add_employee()) 
				{$data['patients']=$q;}
	
	  $data['main_content']='view_staff';
	  $this->load->view('includes/template',$data);
					

	
	
	}	
}
?>